package com.reserveme.servlet;
import java.io.IOException;

import javax.servlet.RequestDispatcher;
import javax.servlet.http.*;

import com.reserveme.QueryWrapper;

@SuppressWarnings("serial")
public class ReserveMeServlet extends HttpServlet {
	public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException {
		QueryWrapper wrapper = new QueryWrapper();
		try {
			String date = request.getParameter("dateParam");
			String grnd = request.getParameter("grndParam");
			
			wrapper.insert(date, grnd);
			
			request.setAttribute("date", date);
			request.setAttribute("grnd", grnd);
			
			
			RequestDispatcher view = request.getRequestDispatcher("reserve.jsp");
			view.forward(request, response);
		} catch(Exception e) {
			System.out.println(e.getMessage() + "\n" + "BUGGGGGG");
		}
	}
}
